<?php

/**
 * @Author: Wang chunsheng  email:2192138785@qq.com
 * @Date:   2023-04-12 23:28:12
 * @Last Modified by:   Wang chunsheng  email:2192138785@qq.com
 * @Last Modified time: 2023-05-22 16:59:38
 */

namespace App\WebSocketController;

use Common\WebSocketController;
use Hyperf\HttpServer\Annotation\AutoController;

#[AutoController]
class IndexController extends WebSocketController
{
    public function onClose($server, int $fd, int $reactorId): void
    {
        // TODO: Implement onClose() method.
    }

    public function onMessage($server, $frame): void
    {
        $Res = $this->writeJson(200,[],'欢迎使用店滴云');
        $server->push($frame->fd,json_encode($Res,JSON_UNESCAPED_UNICODE));
    }

    public function onOpen($server, $request): void
    {
        // TODO: Implement onOpen() method.
    }
}
